package com.zhuangjie.order.feign;

import com.zhaungjie.base.conduit.TypeR;
import com.zhuangjie.coupon.dto.LockCouponsDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;

@Component
@FeignClient(name = "spark-coupon",path = "/coupon")
public interface CouponFeignService {

    @ApiOperation("优惠券锁定-仅内部调用接口")
    @PutMapping("/coupon/lock-coupons")
    TypeR<Void> lockCoupons(@RequestBody LockCouponsDTO lockCouponsDTO);

    @ApiOperation("取消锁定退还优惠券-仅内部调用接口")
    @PutMapping("/coupon/un-lock-coupons")
    TypeR<Void> unLockCoupons(@Valid @RequestBody LockCouponsDTO lockCouponsDTO);
}
